SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[_Grn_GetByDate]
    @fromdate DATETIME ,
    @todate DATETIME
AS 
    BEGIN
        SELECT  [GRNId] ,
                [GRNDate] ,
                [SupplierID] ,
                [Name] ,
                [Amount] ,
                G.[Remark]
        FROM    [UFPharma].[dbo].[GRN] G
                INNER JOIN WEBUSER W ON G.PreparedBy = W.UserId
        WHERE   Grndate BETWEEN @fromdate AND @todate
                AND LEFT([GRNId], 1) = 'G'
        SELECT  [GRNId] ,
                [GRNDate] ,
                [SupplierID] ,
                [Name] ,
                [Amount] ,
                G.[Remark]
        FROM    [UFPharma].[dbo].[GRN] G
                INNER JOIN WEBUSER W ON G.PreparedBy = W.UserId
        WHERE   Grndate BETWEEN @fromdate AND @todate
                AND LEFT([GRNId], 1) = 'A'
    END
GO
